package com.xinsilu.product.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface ProductMapper {
    @Select("SELECT productCount FROM product WHERE id=#{id}  for update")
    int getProductCountByID(@Param("id") int id);
    @Update("update product set productCount = productCount - #{buyCount} where id=#{id}")
    int updateProductCountById(@Param("id") int id,@Param("buyCount") int buyCount);


}
